﻿using Husb.DataUtil;
using System.Data;
namespace CentralOffice.Task.Data {
    
    
    public partial class ApprovalDataSet {
        public partial class ApprovalsRow
        {
            #region GenerateFilterExpression
            public string FilterExpression
            {
                get
                {
                    string where = "";
                    //where += DataAccessUtil.GetPartWhereCondition("Id", this.Id);


                    where += DataAccessUtil.GetPartWhereCondition("ApplicationId", this, DbType.Guid);
                    where += DataAccessUtil.GetPartWhereCondition("ApprovedBy", this, true);
                    where += DataAccessUtil.GetPartWhereCondition("DateApproved", "DateApprovedEnd", this);
                    where += DataAccessUtil.GetPartWhereCondition("ContentText", this);
                    where += DataAccessUtil.GetPartWhereCondition("Opinion", this);
                    where += DataAccessUtil.GetPartWhereCondition("ResultApproved", this, DbType.Boolean);
                    where += DataAccessUtil.GetPartWhereCondition("PreviousStep", this, DbType.Guid);
                    where += DataAccessUtil.GetPartWhereCondition("IsFinal", this, DbType.Boolean);

                    where += DataAccessUtil.GetPartWhereCondition("Name", this);
                    where += DataAccessUtil.GetPartWhereCondition("Applicant", this, true);
                    where += DataAccessUtil.GetPartWhereCondition("DateOfApplication", "DateOfApplicationEnd", this);
                    where += DataAccessUtil.GetPartWhereCondition("ApprovalContent", this);
                    where += DataAccessUtil.GetPartWhereCondition("Status", this, DbType.Int32);
                    where += DataAccessUtil.GetPartWhereCondition("Category", this, DbType.Int32, false);

                    //if (this["IsDeleted"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("IsDeleted", this.IsDeleted );
                    //if (this["IsActive"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("IsActive", this.IsActive);
                    //if (this["CreatedTime"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("CreatedTime", this.CreatedTime);
                    //if (this["CreatedBy"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("CreatedBy", this.CreatedBy);
                    //if (this["ModifiedTime"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("ModifiedTime", this.ModifiedTime);
                    //if (this["LastModifiedBy"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("LastModifiedBy", this.LastModifiedBy);
                    //if (this["Version"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("Version", this.Version);
                    //if (this["Description"] != System.DBNull.Value) where += DataAccessUtil.GetPartWhereCondition("Description", this.Description);

                    return where;
                }
            }

            #endregion

        }
    }
    
}
